package org.simple.framework.data.jpa.repository;

import org.simple.framework.data.entity.Identifiable;
import org.simple.framework.data.query.BaseQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.NoRepositoryBean;

import java.io.Serializable;
import java.util.List;

/**
 * 项目名称：simple-framework
 * 类名称：JpaModelRepository
 * 类描述：JpaModelRepository
 * 创建时间：2018/8/15
 *
 * @author sisyphus   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
@NoRepositoryBean
public interface JpaModelRepository<E extends Identifiable<ID>, ID extends Serializable> extends JpaRepository<E, ID>, JpaSpecificationExecutor<E>, QuerydslPredicateExecutor<E> {

    List<E> findAll(BaseQuery<E> query);

    Page<E> findAll(BaseQuery<E> query, Pageable pageable);

}
